<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<span>北京</span>
<span>上海</span>
<span>广州</span>
<script src="../js/jquery-1.4.2.js"></script>
<script>
    //给所有span添加鼠标移入移出方法
    $('span').hover(function () {
        $(this).css('color','red')
    },function () {
        $(this).css('color','green')
    })
</script>
</body>
</html>